package com.yinian.server.service.impl;

import com.yinian.pojo.dto.TeachDetailDTO;
import com.yinian.pojo.entity.App;
import com.yinian.pojo.entity.AppModule;
import com.yinian.pojo.vo.CommunityVO;
import com.yinian.server.mapper.CommunityMapper;
import com.yinian.server.mapper.TeachMapper;
import com.yinian.server.service.CommunityService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.text.SimpleDateFormat;
import java.time.LocalDateTime;
import java.time.ZonedDateTime;
import java.util.Date;
import java.util.List;

@Slf4j
@Service
public class CommunityServiceImpl implements CommunityService {

    @Autowired
    private CommunityMapper communityMapper;


    @Override
    public List<CommunityVO> getCommunity() {
        return communityMapper.getCommunityList();
    }

    @Override
    public void insertMessage(long userId, String content) {
        log.info(LocalDateTime.now().toString());
        communityMapper.insertMessage(userId,content, LocalDateTime.now());
    }
}
